#include <ngx_core.h>
static char *ngx_core_hw_enable_handler(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);

static ngx_command_t  ngx_core_hw_commands[] = {
		//hw意思是hello world

    { ngx_string("ngx_core_hw_enable"),
      NGX_MAIN_CONF|NGX_CONF_TAKE1,
      ngx_core_hw_enable_handler,
      0,
      0,
      NULL },

    ngx_null_command
};

//此表明这个模块是核心模块
static ngx_core_module_t  ngx_core_hw_module_ctx = {
	  //nchw意思是ngx_core_hello_world
    ngx_string("nchw"),
    NULL,
    NULL
};


ngx_module_t  ngx_core_hw_module = {
    NGX_MODULE_V1,
    &ngx_core_hw_module_ctx,                  /* module context */
    ngx_core_hw_commands,                     /* module directives */
    NGX_CORE_MODULE,                       /* module type */
    NULL,                                  /* init master */
    NULL,                                  /* init module */
    NULL,                                  /* init process */
    NULL,                                  /* init thread */
    NULL,                                  /* exit thread */
    NULL,                                  /* exit process */
    NULL,                                  /* exit master */
    NGX_MODULE_V1_PADDING
};


static char *ngx_core_hw_enable_handler(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
    ngx_str_t        *value;

    value = (ngx_str_t *)cf->args->elts;

    if (ngx_strcasecmp(value[1].data, (u_char *) "on") == 0) {
			  printf("hello world!\n");
    } 
    return (char *)NGX_CONF_OK;
}



